def getFunc(flag):
    def sum(a, b):
        return a + b
    def jianfa(a, b):
        return a - b

    if flag == '+':
        return sum
    elif flag == '-':
        return jianfa

print(
    getFunc('+')(1, 2)
)

print(
    getFunc('-')(1, 2)
)
